package j20251104;

import java.util.HashSet;

public class Demo1 {
    public static void main(String[] args) {
        HashSet<Integer> hashSet = new HashSet<>();
        hashSet.add(1);
        hashSet.add(2);
        hashSet.add(3);
        System.out.println(hashSet);
        //删除
        hashSet.remove(1);
        System.out.println(hashSet);
        //遍历
        for (Integer i : hashSet) {
            System.out.println(i);
        }
    }
}
